package cn.liziy.service.impl;

import cn.liziy.dao.UserDao;
import cn.liziy.entity.User;
import cn.liziy.service.UserService;
import liziy.spring.beans.factory.annotation.Autowired;
import liziy.spring.beans.factory.annotation.Scope;
import liziy.spring.core.stereotype.Service;
import liziy.spring.beans.factory.config.BeanDefinition;

/**
 * @author Liziy
 * @date 2020/12/15 22:56
 **/

@Service
//@Scope(BeanDefinition.SCOPE_SINGLETON)
@Scope(BeanDefinition.SCOPE_SINGLETON)
public class UserServiceImpl implements UserService {

    public UserServiceImpl(){
        System.out.println("init-->UserServiceImpl");
    }

    @Autowired
    private UserDao userDao;

    @Override
    public User getUserById(int id) {
        return userDao.queryById(id);
    }
}
